import axios from 'axios';

export default class{

    //查询所有合同类型
    getContractTypeList(){
        return axios.get(`http://localhost/WyhSubcontracts`)
    }

    //批量添加分包合同
    addLaborSubcontract(subcontracts,tenderPurchaseDetails){
        var a = {}
        a.subcontracts=subcontracts
        a.tenderPurchaseDetails=tenderPurchaseDetails
        return axios.post(`http://localhost/WyhSubcontracts`,a)
    }

    //查询所有分包合同
    getSubcontracts(searchSubcontract){
        return axios.get(`http://localhost/WyhSubcontracts/list`,{
            params:searchSubcontract
        })
    }

    //获取合同编号
    getMaxCode(){
        return axios.get(`http://localhost/WyhSubcontracts/code`)
    }

    //删除分包合同
    deleteByIdSubcontract(i){
        return axios.delete(`http://localhost/WyhSubcontracts/${i}`)
    }

    //根据分包合同id查询
    getByIdSubcontract(id){
        return axios.get(`http://localhost/WyhSubcontracts/getList/${id}`)
    }

    //修改
    updateSubcontract(a){
        return axios.put(`http://localhost/WyhSubcontracts/update/`,a)
    }
}